<div class="mainbox">
    <div class="conbox {{f}}">
        {{#if $Cache.user.collectBus_with_goods_info.length}}
        {{#each $Cache.user.collectBus_with_goods_info}}
        <coitem src="{{info.logo_url&&(info.logo_url+'?imageView/1/w/50/h/50')||'/images/logo.png'}}" title="{{info.title}}"></coitem>
        {{/each}}
        {{#else}}
        <div class="coitem">
            <p>暂没有收藏店铺</p>
        </div>
        {{/if}}
    </div>
    <div class="conbox">
        {{#if $Cache.user.collect_detail.length}}
        {{#each $Cache.user.collect_detail}}
        <div class="coitem">
            <div class="imgbox">
                <a href="mobile.main.html#default/goods_details?id={{_id}}"><img class="logoimg" src="{{preview_img_url}}?imageView/1/w/112/h/112" /></a>
            </div>
            <div class="info">
                <a href="mobile.main.html#default/goods_details?id={{_id}}"><div class="item g">{{goods_name}}</div></a>
                <div class="item g">
                    <span class="price">￥{{price}}</span>
                </div>
                <div class="item g">
                    <sbutton shadownum1="0 0 8px 0" shadownum2="0 0 4px 0" class="btn cobtn" text="添加到购物车" event-click="{{'$Top.$Event.user.collect_goods_add_to_cart'}}"></sbutton>
                    <sbutton shadownum1="0 0 8px 0" shadownum2="0 0 4px 0" class="btn cobtn" text="移除" event-click="{{'$Top.$Event.remove_goods_from_collect'}}"></sbutton>
                </div>
            </div>
        </div>
        {{/each}}
        {{#else}}
        <div class="coitem">暂没有收藏商品</div>
        {{/if}}
    </div>
   
</div>
<xmp type="tag" name="coitem">
    <div class="coitem">
        <div class="imgbox">
            <img class="logoimg" src="${src}">
        </div>
        <div class="info">
            <div class="item">${title}<div style="padding:0.4rem;display:inline-block;" class="icon-sina-weibo" event-click="{{'$Event.share'}}"></div></div>
            <div class="item">
                <sbutton shadownum1="0 0 8px 0" shadownum2="0 0 4px 0" class="btn" text="直接访问" event-click="{{'$Event.href'}}"></sbutton>
                <sbutton shadownum1="0 0 8px 0" shadownum2="0 0 4px 0" class="btn" text="删除" event-click="{{'$Top.$Event.user.remove_collect_bus'}}"></sbutton>
                
            </div>
        </div>
    </div>
    <script type="text/vm">
    function(vm){
    	require(['common'],function(){
    		vm.set('$Event.href',function(){
    			window.open(vm.get('url'));
    		});
    		vm.set('$Event.share',function(){
    			var title='我觉得#'+vm.get('info.title')+'#这网站不错，推荐给大家';
    			var pic=vm.get('info.logo_url');
    			if(pic){
    				pic=pic+'?imageView/1/w/200/h/200';
    			}else{
    				pic=vm.get('url')+'/images/logo.png';
    			}
    			var rLink = vm.get('url');
    			window.open("http://service.weibo.com/share/share.php?pic=" + encodeURIComponent(pic) + "&title=" +encodeURIComponent(title.replace(/&nbsp;/g, " ").replace(/<br \/>/g, " ")) + "&url=" + encodeURIComponent(rLink),
                        "分享至新浪微博",
                        "toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");
    		});
    	});
    }
    </script>
</xmp>
